import 'package:flutter/material.dart';

class ShadowedText extends StatelessWidget {
  final String? text;
  final TextStyle style;
  final Color shadowColor;
  final double blurRadius;
  final Offset offset;

  final int? maxLines;
  final TextOverflow? overflow;
  final bool? softWrap;


  const ShadowedText(this.text, {
    super.key,
    this.style = const TextStyle(fontSize: 15, color: Colors.black),
    this.shadowColor = Colors.black26,
    this.blurRadius = 3.0,
    this.offset = const Offset(0, 1),
    this.maxLines,
    this.overflow,
    this.softWrap
  });

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        // Shadow text
        Positioned(
          left: offset.dx,
          top: offset.dy,
          child: Text(
            text ?? "",
            style: style.copyWith(color: shadowColor),
            maxLines: maxLines,
            overflow: overflow,
            softWrap: softWrap,
          ),
        ),
        // Main text
        Text(
          text ?? "",
          style: style,
          maxLines: maxLines,
          overflow: overflow,
          softWrap: softWrap,
        ),
      ],
    );
  }
}